<?php

namespace App\Controllers;
use App\Models\Places;

class Travel extends BaseController
{
    public function index()
    {
        //get the model
        $places = new Places();

        //get the array of places
        $records = $places->findAll();
        //return the view
        $parser = \Config\Services::parser();
        return $parser->setData(['records' => $records])
            ->render('placeslist');
    }

    public function showme($id)
    {
        $places = new Places();
        $record = $places->find($id);
        $parser = \Config\Services::parser();
        return $parser->setData($record)
        ->render('oneplace');
    }
}